package acm;

import java.util.Scanner;

public class a8 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
         int n=in.nextInt();
         int [] a = new int[n];
         for (int i=0;i<a.length;i++){
             a[i]=in.nextInt();
         }
        int max=a[0],min=a[0],sum=0;
         for (int j=0;j<a.length;j++){
             if (a[j]>max){
                 max=a[j];
             }
         }
         for (int j=0;j<a.length;j++){
             if (a[j]<min){
                 min=a[j];
             }
         }
         for (int j=0;j<a.length;j++){
             sum+=a[j];
         }
         System.out.println(max);
         System.out.println(min);
         System.out.println(sum);
    }
}
